home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 34.zip / BS1 part 34 / FredFish PD 307.adf / Samp / ToSAMP.asm < prev    next >
Assembly Source File  |  1990-01-13  |  32KB  |  1,138 lines

  1. ; Assembled with Innovatronic's CAPE assembler with the SMALLOBJ directive.
  2. ; (i.e. PC relative code) For other assemblers, uncomment the section
  3. ; directive before the data section.
  4. ; Link as follows:
  5. ; Blink SmallStart.o ToSAMP.o small.lib NODEBUG to ToSAMP
  6. ; where SmallStart.o is the startup code included with this program and
  7. ; small.lib is Bryce Nesbitt's amiga lib.
  8. ; For Manx,
  9. ; as -cd -o ToSAMP ManxStartUp.o ToSAMP.o -lcl32
  10. ;
  11. ; This example uses R.J. Mical's FileIO requester in a special library form
  12. ; prepared by dissidents.
  13.  
  14.   SMALLOBJ
  15.   OBJFILE  "rad:ToSamp.o"
  16.   OPTIMON
  17.   ADDSYM
  18.  
  19.   INCLUDE  "rad:FileIO.i" ;requires RJ Mical's FileIO in library form
  20.  
  21.          SECTION  ToSampCode,CODE
  22.  
  23.    XREF  _DOSBase,_SysBase ;from StartUp code
  24.  
  25.    XREF  _LVOOpenLibrary,_LVOCloseLibrary,_LVOOpenWindow,_LVOCloseWindow
  26.    XREF  _LVOAllocMem,_LVOFreeMem
  27.    XREF  _LVOGetMsg,_LVOReplyMsg,_LVOWait,_LVOWaitPort
  28.    XREF  _LVOPrintIText,_LVODrawImage
  29.    XREF  _LVOMove,_LVOText,_LVOSetAPen
  30.    XREF  _LVOOpen,_LVORead,_LVOWrite,_LVOClose,_LVODelay
  31.    XREF  _LVOLock,_LVOUnLock,_LVOExamine,_LVODeleteFile
  32.  
  33. MODE_OLDFILE equ 1005
  34. MODE_NEWFILE equ 1006
  35. LIB_VERSION  equ 33
  36.  
  37.    XDEF print_type
  38. print_type:
  39.     bsr.s   blank
  40.     moveq   #0,d0
  41.     move.b  d5,d0
  42.     add.b   d0,d0
  43.     add.b   d0,d0
  44.     lea     TYPES,a0
  45.     adda.l  d0,a0
  46.     move.l  (a0),a4
  47.     moveq   #0,d2
  48.     move.b  (a4)+,d2
  49.     move.b  d2,NumOfChoices
  50.     moveq   #10,d3
  51.     moveq   #10,d4
  52. mgg moveq   #26,d0
  53.     add.w   d3,d4
  54.     move.w  d4,d1
  55.     bsr.s   print_msg  ;returns end of msg (beginning of next string)
  56.     Dbra    d2,mgg
  57.     rts
  58.  
  59. blank:
  60.    moveq   #17-1,d2
  61.    moveq   #10,d3
  62.    moveq   #10,d4
  63. mG lea     SPACES,a4
  64.    moveq   #26,d0
  65.    add.w   d3,d4
  66.    move.w  d4,d1
  67.    bsr.s   print_msg
  68.    Dbra    d2,mG
  69.    rts
  70.  
  71.   XDEF print_msg  ;string passed in a4, x in d0, y in d1
  72. print_msg:
  73.     movea.l   RastPort,a2
  74.     movea.l   a2,a1
  75.     movea.l   _GfxBase,a6
  76.     jsr       _LVOMove(a6)
  77.     movea.l   a4,a0
  78. len move.b    (a4)+,d0
  79.     bne.s     len
  80.     move.l    a4,d0
  81.     subq.l    #1,d0
  82.     sub.l     a0,d0           ;length of string
  83.     movea.l   a2,a1           ;RastPort
  84.     jmp       _LVOText(a6)
  85.  
  86.    XDEF print_directions
  87. print_directions:
  88.    lea     Directions,a4
  89.    lea     Positions,a5
  90.    moveq   #10-1,d2
  91.    moveq   #10,d3
  92.    moveq   #10,d4
  93. mg move.w  (a5)+,d0
  94.    add.w   d3,d4
  95.    move.w  d4,d1
  96.    bsr.s   print_msg  ;returns end of msg (beginning of next string)
  97.    Dbra    d2,mg
  98.    rts
  99.  
  100.    XDEF print_family
  101. print_family:
  102.    bsr     blank
  103.    lea     Family,a4
  104.    moveq   #17-1,d2
  105.    moveq   #10,d3
  106.    moveq   #10,d4
  107. MG moveq   #26,d0
  108.    add.w   d3,d4
  109.    move.w  d4,d1
  110.    bsr.s   print_msg  ;returns end of msg (beginning of next string)
  111.    Dbra    d2,MG
  112.    rts
  113.  
  114. Positions dc.w 38,28,38,26,30,39,29,24,30,84
  115.  
  116.    XDEF _main
  117. _main:
  118. ;---Open Gfx Library
  119.         movea.l  _SysBase,a6
  120.         moveq    #LIB_VERSION,d0
  121.         lea      GfxName,a1
  122.         jsr      _LVOOpenLibrary(a6)
  123.         move.l   d0,_GfxBase
  124.         bne.s    xx
  125.         rts
  126. ;---Open Intuition
  127. xx      moveq    #LIB_VERSION,d0
  128.         lea      IntuitionName,a1
  129.         jsr      _LVOOpenLibrary(a6)
  130.         move.l   d0,_IntuitionBase
  131.         beq      clG
  132. ;---Open the main window
  133.         lea      newWindow,a0
  134.         move.l   a6,-(sp)
  135.         movea.l  d0,a6
  136.         jsr      _LVOOpenWindow(a6)
  137.         movea.l  (sp)+,a6
  138.         move.l   d0,WindowPtr
  139.         beq      clI
  140.         move.l   d0,a0
  141.         move.l   50(a0),RastPort
  142. ;---Open the FileIO (requester) library
  143.         moveq     #1,d0            ;version #1
  144.         lea       RequesterName,a1
  145.         jsr       _LVOOpenLibrary(a6)
  146.         move.l    d0,_RequesterBase
  147.         bne.s     gotit
  148.         ;---error
  149.         lea       FileReqErr,a4
  150.         moveq     #5,d0
  151.         moveq     #75,d1
  152.         bsr       print_msg
  153.         moveq     #100,d1
  154.         movea.l   _DOSBase,a6
  155.         jsr       _LVODelay(a6)
  156.         bra       clW
  157. ;===================Get the FileIO Structure========================
  158. gotit   movea.l   d0,a6
  159.         jsr       _LVOGetFileIO(a6)
  160.         move.l    d0,FileIO
  161.         bne.s     gotIO
  162.         lea       IOerR,a4
  163.         moveq     #5,d0
  164.         moveq     #75,d1
  165.         bsr       print_msg
  166.         moveq     #100,d1
  167.         movea.l   _DOSBase,a6
  168.         jsr       _LVODelay(a6)
  169.         bra       clF
  170.   ;---Set up info file suppression
  171. gotIO   movea.l   d0,a0
  172.         Bset.b    #INFO_SUPPRESS,1(a0)  ;INFO_SUPPRESS ON
  173.   ;--Set up the XY co-ordinates of where the requester will open
  174.   ; If we used DoFileIOWindow(), we wouldn't need to set co-ordinates.
  175.         moveq     #6,d0
  176.         move.w    d0,FILEIO_X(a0)  ;x position
  177.         moveq     #11,d0
  178.         move.w    d0,FILEIO_Y(a0)  ;y position
  179.   ;---Setup buffer for path name
  180.         lea       _BUFFER2,a1
  181.         move.l    a1,FILEIO_BUFFER(a0)
  182.   ;---Setup Pens and DrawMode
  183.         moveq     #1,d0
  184.         move.b    d0,FILEIO_DRAWMODE(a0)
  185.         move.b    d0,FILEIO_PENA(a0)
  186. ;====Create a mask of the Window's UserPort's mp_Sigbit=====
  187.         movea.l   WindowPtr,a3
  188.         movea.l   86(a3),a0
  189.         move.b    15(a0),d0
  190.         moveq     #0,d7
  191.         Bset.l    d0,d7
  192. ;----Print out Directions
  193. START   bsr       print_directions
  194. ;********************** MAIN LOOP ******************************
  195. ;=====Get the message that arrived at our UserPort====
  196. E4     movea.l   86(a3),a0
  197.        movea.l   _SysBase,a6
  198.        jsr       _LVOGetMsg(a6)
  199.        move.l    d0,d1
  200.        bne.s     E7
  201. ;===Check if we are ready to exit the program=====
  202.        Btst.b    #0,Quit
  203.        beq       delFile
  204. ;===Wait for a message sent to our Window (from Intuition)===
  205.        move.l    d7,d0
  206.        jsr       _LVOWait(a6)
  207.        bra.s     E4
  208. ;====Copy all the info we want from the IntuiMessage====
  209. E7    movea.l   d0,a1
  210.       lea       20(a1),a0  ;get the address of the first field to copy.
  211.       move.l    (a0)+,d6   ;Copy the Class field to d6
  212.       move.w    (a0)+,d5   ;Copy the Code field to d5
  213.       move.w    (a0)+,d4   ;Copy the qualifier field to d4
  214.       movea.l   (a0)+,a2   ;Copy the IAddress field to a2
  215.       move.w    (a0)+,d3   ;Copy MouseX position to d3
  216.       move.w    (a0)+,d2   ;Copy MouseY position to d2
  217. ;====Now reply to the message so Intuition can dispose of it
  218. E8  ;Address of the message is in a1.
  219.       jsr       _LVOReplyMsg(a6)
  220. ;========switch (class)=========
  221.       Bclr.l    #3,d6  ;MOUSEBUTTONS
  222.       bne.s     GADG
  223.       Bclr.l    #9,d6  ;CLOSEWINDOW
  224.       beq.s     E4
  225. ;=========case CLOSEWINDOW:============
  226. CW    Bclr.b    #0,Quit
  227.       bra.s     E4
  228. ;=========case MOUSEBUTTONS:===========
  229. ;---Make sure that it's an UP select if MOUSEBUTTONS
  230. GADG  subi.b    #$68,d5
  231.       beq       E4     ;ignore down
  232.      ;---get the user's filename and load the 8SVX file
  233. E2    bsr       load_8SVX
  234.       subq.b    #1,d0
  235.       bne.s     Cerr
  236.      ;---Convert the file to SAMP and save
  237.       bsr       convert_8SVX
  238.       subq.b    #1,d0
  239.       bne.s     Cerr
  240.       ;---Indicate a successful conversion
  241.       lea       Success,a4
  242.   ;---delete the 8SVX conversion buffer if it exists
  243. Cerr  bsr       free_data
  244.       move.l    a4,-(sp)
  245.       bsr       blank
  246.   ;---Print the returned error message
  247.       movea.l   _RequesterBase,a6
  248.       movea.l   a3,a0
  249.       move.l    (sp)+,d0
  250.       jsr       _LVOAutoMessage(a6)
  251.       bra       START
  252. ;******************** Exit the Program *********************
  253.      ;If the pointer to FileIO was NULL, then
  254.      ;ReleaseFileIO just returns, so it's safe to
  255.      ;always release any return value of GetFileIO.
  256. delFile  movea.l  FileIO,a1
  257.          movea.l  _RequesterBase,a6
  258.          jsr      _LVOReleaseFileIO(a6)
  259.     ;---Close the graphics lib
  260. clF      movea.l  _RequesterBase,a1
  261.          movea.l  _SysBase,a6
  262.          jsr      _LVOCloseLibrary(a6)
  263.     ;---Close the window
  264. clW      movea.l  WindowPtr,a0
  265.          movea.l  _IntuitionBase,a6
  266.          jsr      _LVOCloseWindow(a6)
  267.     ;---Close the Intuition Lib
  268. clI      movea.l  _SysBase,a6
  269.          movea.l  _IntuitionBase,a1
  270.          jsr      _LVOCloseLibrary(a6)
  271.     ;---Close the graphics lib
  272. clG      movea.l  _GfxBase,a1
  273.          jmp      _LVOCloseLibrary(a6)
  274.  
  275.   XDEF load_8SVX
  276. load_8SVX:
  277.        movem.l  d2/d3/d4/d5,-(sp)
  278.  ;---Get the user's filename via the FileIO requester
  279.        movea.l  WindowPtr,a1
  280.        movea.l  FileIO,a0
  281.        movea.l  _RequesterBase,a6
  282.        jsr      _LVODoFileIO(a6)
  283.        move.l   d0,d1
  284.        bne.s    L92    ;If 0, must have been an error
  285.        lea      LibErr,a4
  286. outL   movem.l  (sp)+,d2/d3/d4/d5
  287.        rts
  288. L92    addq.l   #1,d0
  289.        bne.s    L90
  290.    ;---If -1, user must have selected CANCEL
  291.        lea      Cancel,a4
  292.        bra.s    outL
  293.    ;---Get the File's Size
  294. L90    movea.l   FileIO,a0
  295.        move.l    FILEIO_FILESIZE(a0),d0
  296.        move.l    d0,FileSize
  297.        bne.s     L89
  298.        ;---If size = 0, then this file must not exist (in this directory)
  299. L95    lea       CantFind,a4
  300.        bra.s     outL
  301.    ;---get a conversion buffer to copy in the entire 8SVX file
  302. L89    movea.l   _SysBase,a6
  303.        moveq     #1,d1
  304.        jsr       _LVOAllocMem(a6)
  305.        move.l    d0,_8SVXData   ;the address of conversion buffer
  306.        bne.s     L93
  307.        move.l    d0,FileSize    ;size of conversion buffer
  308.        lea       NoMem,a4
  309.        bra.s     outL
  310.    ;---Open the file
  311. L93    moveq     #0,d2
  312.        move.w    #MODE_OLDFILE,d2
  313.        lea       _BUFFER2,a0
  314.        move.l    a0,d1
  315.        movea.l   _DOSBase,a6
  316.        jsr       _LVOOpen(a6)
  317.        move.l    d0,d4
  318.        beq.s     L95
  319.    ;---Make sure that this is an 8SVX file
  320.        moveq     #20,d3     ;read the first 20 bytes
  321.        move.l    _8SVXData,d2
  322.        move.l    d4,d1
  323.        jsr       _LVORead(a6)
  324.        sub.l     d0,d3
  325.        bne.s     CloseR
  326.        movea.l   _8SVXData,a0
  327.        addq.l    #8,a0
  328.        move.l    _8SVX,d0
  329.        sub.l     (a0),d0
  330.        beq.s     readin
  331.        ;---Not 8SVX
  332. NotIFF move.l    d4,d1
  333.        jsr       _LVOClose(a6)
  334.        moveq     #0,d0
  335.        lea       Not8SVX,a4
  336.        bra       outL
  337.    ;---Read in the rest of the file (starting with VHDR's oneShotHiSamples)
  338. readin move.l    FileSize,d3
  339.        moveq     #20,d0
  340.        sub.l     d0,d3
  341.        move.l    _8SVXData,d2 
  342.        move.l    d4,d1
  343.        jsr       _LVORead(a6)
  344.        sub.l     d0,d3
  345. CloseR move.l    d4,d1
  346.        jsr       _LVOClose(a6)
  347.        moveq     #1,d0
  348.        move.l    d3,d1
  349.        beq       outL
  350.        lea       ReadErr,a4
  351.        moveq     #0,d0
  352.        bra       outL
  353.  
  354. ; This frees the conversion buffer when we are done with it, and also
  355. ; re-initializes the data section for converting another file.
  356.  
  357.   XDEF free_data
  358. free_data:
  359.      lea     _8SVXData,a0
  360.      move.l  (a0),d0
  361.      beq.s   no8D
  362.      clr.l   (a0)+
  363.      movea.l d0,a1
  364.      move.l  (a0),d0  ;FileSize
  365.      clr.l   (a0)
  366.      movea.l _SysBase,a6
  367.      jmp     _LVOFreeMem(a6)
  368. no8D move.l  d0,4(a0)
  369.      clr.l    ATAKptr
  370.      clr.l    RLSEptr
  371.      clr.l    sizeOfBODY
  372.      clr.l    nameSize
  373.      moveq    #-1,d0
  374.      move.w   d0,midiSampNum
  375.      lea      playMap,a1
  376.      moveq    #128-1,d0
  377. cpm  clr.l    (a1)+
  378.      dbra     d0,cpm
  379.      rts
  380.  
  381.    XDEF divide
  382.  ;This routine divides 2 LONGS passed in d0 and d1.
  383.  ;d0 = d0/d1 with d2 = the remainder.
  384. divide:
  385.     moveq   #0,d2
  386.     moveq   #31,d3
  387. _1  asl.l   #1,d0
  388.     roxl.l  #1,d2
  389.     cmp.l   d1,d2
  390.     bcs.s   _2
  391.     sub.l   d1,d2
  392.     addq.l  #1,d0
  393. _2  Dbra    d3,_1
  394.     rts
  395.  
  396.    XDEF convert_8SVX
  397. convert_8SVX:
  398.      movem.l  d2/d3/d4/d5/a3/a4,-(sp)
  399.   ;---Make the SAMP playMap. Assign each interpolation an octave in the map
  400.   ;   The numOfChans in the playMap will be 4.
  401.      movea.l  _8SVXData,a4
  402.      lea      playMap,a1
  403.      moveq    #0,d0
  404.      move.b   14(a4),d0  ;the number of octaves in the 8SVX file
  405.      beq      CCC
  406.   ;---limit to 10 octaves of the 8SVX file (numbered 1 to 10)
  407.      moveq    #10,d1
  408.      cmp.b    d1,d0
  409.      bls.s    okOT
  410.      move.b   d1,d0
  411. okOT move.b   d0,numOfWaves
  412. nto  moveq    #12-1,d1  ;1 octave of notes
  413. octt move.b   d0,(a1)+
  414.      move.b   d0,(a1)+
  415.      move.b   d0,(a1)+
  416.      move.b   d0,(a1)+
  417.      Dbra     d1,octt
  418.      subq.b   #1,d0
  419.      bne.s    nto
  420.   ;---Store the sampleRate
  421.      move.w   12(a4),d1  ;samplesPerSec
  422.      beq.s    def
  423.      move.l   d1,sampleRate
  424.      ;---calculate samplePeriod
  425.      move.l   #1000000000,d0 ;in nanoseconds
  426.      bsr.s    divide
  427.      move.l   d0,samplePeriod
  428. def  lea      20(a4),a0      ;the chunk after VHDR
  429. ;================PROCESS AN 8SVX CHUNK================
  430. nChk bsr      DoWeWantIt
  431.      beq      BodyHandler ;the last chunk in 8SVX
  432.      subq.b   #1,d0
  433.      beq.s    DoName
  434.      subq.b   #1,d0
  435.      beq      DoATAK
  436.      subq.b   #1,d0
  437.      beq      DoRLSE
  438.    ;---Throw away this chunk (i.e. ANNO, AUTH)
  439. thrw move.l   4(a0),d0 ;chunk size
  440.      Btst.l   #0,d0
  441.      beq.s    even
  442.      addq.l   #1,d0
  443. even addq.l   #8,a0
  444.      adda.l   d0,a0    ;skip to the end of the chunk
  445.      bra.s    nChk
  446. ;--'NAME': Copy the "Master" name to name buffer and count # of chars
  447. ;  including NULL (+1 to append the wave number). Calculate the final
  448. ;  resulting chunk size. Make sure that the name is an even # of bytes.
  449. DoName:
  450.      lea      name,a1
  451.      moveq    #19-1,d0 ;copy 19 chars (including NULL) Max
  452.      movea.l  a0,a3
  453.      addq.l   #8,a3
  454.      move.l   a1,d1
  455. cnm  move.b   (a3)+,(a1)+
  456.      Dbeq     d0,cnm
  457.      move.l   a1,d0
  458.      clr.b    -(a1)
  459.      sub.l    d1,d0  ;length of 1 wave name counting NULL
  460.      addq.l   #1,d0  ;allow for appending the wave (octave) number
  461.      Btst.l   #0,d0
  462.      beq.s    EVEN
  463.      addq.l   #1,d0
  464.      move.b   #' ',(a1)+
  465. EVEN move.l   a1,nameNULL
  466.      moveq    #0,d1
  467.      move.b   numOfWaves,d1
  468.      mulu.w   d1,d0     
  469.      move.l   d0,nameSize
  470.      bra.s    thrw
  471. ;---Note the address and size (bytes) of the ATAK chunk. We'll copy it to
  472. ;   disc verbatim...once for each wave.
  473. DoATAK:
  474.      movea.l  a0,a3
  475.      addq.l   #4,a3
  476.      move.l   (a3)+,d0
  477.      move.l   d0,sizeOfATAK ;This should always be even.
  478.      move.l   a3,ATAKptr    ;addr of EGpoints[]
  479.    ;---add the (size of chunk) x numOfWaves to sizeOfBODY
  480. sze  moveq    #0,d1
  481.      move.b   numOfWaves,d1
  482.      mulu.w   d1,d0        ;should actually be a LONG multiply just in case!
  483.      add.l    d0,sizeOfBODY
  484.      bra.s    thrw
  485. DoRLSE:
  486.      movea.l  a0,a3
  487.      addq.l   #4,a3
  488.      move.l   (a3)+,d0
  489.      move.l   d0,sizeOfRLSE
  490.      move.l   a3,RLSEptr  ;addr of EGPoints[]
  491.      bra.s    sze
  492. ;================== BODY ==========================
  493. BodyHandler:
  494.  ;===Calculate size of BODY and total size of all chunks
  495.      addq.l   #8,a0       ;get beginning of sample data
  496.      lea      SampleInfo0,a3
  497.      move.b   numOfWaves,d0
  498.      subq.b   #1,d0
  499.      move.l   (a4),d4  ;oneShotHiSamples
  500.      move.l   4(a4),d5 ;repeatHiSamples
  501.      move.l   a0,(a3)+
  502.      move.l   d4,(a3)+
  503.      move.l   d4,d1
  504.      add.l    d5,d1    ;total size of this wave
  505.      move.l   d1,d2    ;store sum of all wave sizes in d2
  506.      moveq    #80,d3   ;80 byte waveHeader in BODY for each wave
  507.      bra.s    _1o
  508.   ;---Store one wave's waveHeader
  509. agns move.l   a0,(a3)+ ;start address of sample data
  510.      lsl.l    #1,d4    ;2x oneShot size
  511.      move.l   d4,(a3)+ ;size of oneShot (also loopStart offset)
  512.      lsl.l    #1,d5    ;size of loop portion
  513.      move.l   d5,d1
  514.      add.l    d4,d1
  515.      add.l    d1,d2
  516. _1o  add.l    d3,d2    ;add size of waveHeader
  517.      move.l   d1,(a3)+ ;loopEnd offset (also this wave's waveSize)
  518.      adda.l   d1,a0    ;next wave
  519.      Dbra     d0,agns
  520.      add.l    d2,sizeOfBODY
  521.   ;---calculate the total size of ALL chunks in the SAMP file
  522.      move.l   nameSize,d0
  523.      beq.s    noNh
  524.      addq.l   #8,d0    ;add 8 bytes for NAME header
  525. noNh add.l    sizeOfBODY,d0
  526.      add.l    d0,sizeOfChunks
  527. ;============== ASK THE USER TO DETERMINE THE INSTRUMENT TYPE =============
  528.   ;---Determine the family
  529.      bsr       print_family
  530.      movea.l   _SysBase,a6
  531. fam  move.l    d7,d0
  532.      jsr       _LVOWait(a6)
  533.      movea.l   WindowPtr,a1
  534.      movea.l   86(a1),a0
  535.      jsr       _LVOGetMsg(a6)
  536.      move.l    d0,d1
  537.      beq.s     fam
  538.      movea.l   d0,a1
  539.      lea       20(a1),a0  ;get the address of the first field to copy.
  540.      move.l    (a0)+,d2   ;Copy the Class field
  541.      move.w    (a0)+,d5   ;Copy the Code field to d5
  542.    ;Address of the message is in a1.
  543.      jsr       _LVOReplyMsg(a6)
  544.    ;---wait for rawkey
  545.      Bclr.l    #10,d2 ;RAWKEY
  546.      beq.s     fam
  547.    ;---Decode rawkey into Family nibble
  548.      Bclr.l    #7,d5
  549.      bne.s     fam    ;key up
  550.      Btst.l    #5,d5
  551.      beq.s     row1
  552.      moveq     #22,d1
  553.      sub.b     d1,d5
  554.      bcs.s     unkn
  555.      cmpi.b    #14,d5
  556.      bcc.s     unkn
  557.      bra.s     gtyp
  558. row1 moveq     #16,d1
  559.      sub.b     d1,d5
  560.      bcs.s     unkn
  561.      cmpi.b    #10,d5
  562.      bcc.s     unkn
  563. gtyp bsr       print_type
  564.      addq.b    #1,d5
  565. type move.l    d7,d0
  566.      movea.l   _SysBase,a6
  567.      jsr       _LVOWait(a6)
  568.      movea.l   WindowPtr,a1
  569.      movea.l   86(a1),a0
  570.      jsr       _LVOGetMsg(a6)
  571.      move.l    d0,d1
  572.      beq.s     type
  573.      movea.l   d0,a1
  574.      lea       20(a1),a0  ;get the address of the first field to copy.
  575.      move.l    (a0)+,d2   ;Copy the Class field
  576.      move.w    (a0)+,d3   ;Copy the Code field to d3
  577.    ;Address of the message is in a1.
  578.      jsr       _LVOReplyMsg(a6)
  579.    ;---wait for rawkey
  580.      Bclr.l    #10,d2 ;RAWKEY
  581.      beq.s     type
  582.      Bclr.l    #7,d3
  583.      bne.s     type    ;key up
  584.    ;---Decode rawkey into Type nibble
  585.      Btst.l    #5,d3
  586.      beq.s     roW1
  587.      moveq     #22,d1
  588.      sub.b     d1,d3
  589.      bcs.s     unkn
  590.      bra.s     gtby
  591. roW1 moveq     #16,d1
  592.      sub.b     d1,d3
  593.      bcs.s     unkn
  594.      cmpi.b    #10,d3
  595.      bcc.s     unkn
  596. gtby cmp.b     NumOfChoices,d3
  597.      bhi.s     unkn
  598.      addq.b    #1,d3
  599.      lsl.b     #4,d3
  600.      or.b      d3,d5
  601.      move.b    d5,Itype
  602.   ;---Ask user if he wants to save to the same Filename with .SAMP extention
  603. unkn lea      _BUFFER2,a0
  604.      lea      SAMPext,a1
  605.      movem.l  a2/a3,-(sp)
  606.      bsr      appendstr
  607.      movea.l  _RequesterBase,a6
  608.      movea.l  WindowPtr,a0
  609.      lea      _BUFFER2,a2
  610.      lea      Same,a1
  611.      suba.l   a3,a3
  612.      jsr      _LVOAutoPrompt3(a6)
  613.      movem.l  (sp)+,a2/a3
  614.      move.b   d0,d1
  615.      bne.s    sav
  616.   ;---Get a new name via the FileIO lib
  617.   ;-----DoFileIO(FileIO, window)
  618.      movea.l  WindowPtr,a1
  619.      movea.l  FileIO,a0
  620.      jsr      _LVODoFileIO(a6)
  621.      addq.l   #1,d0
  622.      bne.s    sav
  623.     ;If -1, user must have selected CANCEL. Abort the Conversion.
  624.      lea      Cancel,a4
  625. outS movem.l  (sp)+,d2/d3/d4/d5/a3/a4
  626.      rts
  627.   ;---Create this file
  628. sav  lea      _BUFFER2,a0
  629.      movea.l  _DOSBase,a6
  630.      move.l   a0,d1
  631.      moveq    #0,d2
  632.      move.w   #MODE_NEWFILE,d2
  633.      jsr      _LVOOpen(a6)
  634.      move.l   d0,d4
  635.      bne.s    fh
  636.     ;---error
  637. CCC  lea      CantCreate,a4
  638.      bra.s    outS
  639.    ;---Write SAMP and MHDR chunks, and the 8 byte NAME header (if it exists)
  640. fh   move.l   #518+8+8,d3
  641.      move.l   nameSize,d2
  642.      beq.s    nNH
  643.      addq.l   #8,d3
  644. nNH  lea      SAMP,a0
  645.      move.l   a0,d2
  646.      move.l   d4,d1
  647.      jsr      _LVOWrite(a6)
  648.      sub.l    d0,d3
  649.      beq.s    wwOK
  650.     ;--WRITE error
  651. WE   move.l   d4,d1
  652.      jsr      _LVOClose(a6)
  653.      lea      _BUFFER2,a0
  654.      move.l   a0,d1
  655.      jsr      _LVODeleteFile(a6)
  656.      lea      WriteErr,a4
  657.      moveq    #0,d0
  658.      bra.s    outS
  659.   ;---Write the NAME chunk (if nameSize is not 0)
  660. wwOK move.l   nameSize,d0
  661.      beq.s    WrOK
  662.      moveq    #0,d5
  663.      move.b   numOfWaves,d5
  664.      subq.b   #1,d5
  665.      ;---append the wave number each time that we write out the name
  666. nnnn movea.l  nameNULL,a0
  667.      move.b   d5,d1
  668.      addi.b   #'0',d1
  669.      move.b   d1,(a0)+
  670.      clr.b    (a0)+
  671.      lea      name,a1
  672.      move.l   a1,d2
  673.      suba.l   a1,a0
  674.      move.l   a0,d3
  675.      move.l   d4,d1
  676.      jsr      _LVOWrite(a6)
  677.      sub.l    d0,d3
  678.      bne.s    WE
  679.      Dbra     d5,nnnn
  680.   ;---Save the 8 byte BODY header
  681. WrOK lea      BODY,a0
  682.      moveq    #8,d3
  683.      move.l   a0,d2
  684.      move.l   d4,d1
  685.      jsr      _LVOWrite(a6)
  686.      sub.l    d0,d3
  687.      bne.s    WE
  688. ;********** SAVE WAVES (80 byte waveHeader and data for each wave) *********
  689.      lea      SampleInfo0,a3
  690.      moveq    #0,d5
  691.      move.b   numOfWaves,d5
  692.      moveq    #12,d0
  693.      mulu.w   d5,d0
  694.      addq.b   #6,d0
  695.      move.b   d0,rootNote  ;set the rootNote for the highest octave
  696.      subq.b   #1,d5
  697. ;================ SAVE 1 WAVE =====================
  698. savesam:
  699.   ;---Store BODY parameters for this wave
  700.      lea      waveSize,a0
  701.      move.l   8(a3),(a0)+ ;store loopEnd in waveSize
  702.      addq.w   #1,(a0)     ;inc midiSampNum
  703.      addq.l   #8,a0
  704.      addq.l   #4,a0
  705.      move.l   4(a3),(a0)+ ;store loopStart
  706.      move.l   8(a3),(a0)+ ;store loopEnd
  707.      subi.b   #12,(a0)    ;dec to middle of previous octave
  708.   ;---Write the 80 byte waveHeader
  709.      moveq    #80,d3
  710.      lea      waveHeader,a0
  711.      move.l   a0,d2
  712.      move.l   d4,d1
  713.      jsr      _LVOWrite(a6)
  714.      sub.l    d0,d3
  715.      bne      WE
  716.   ;---see if there are ATAK EgPoints to write
  717.      move.l   ATAKptr,d2
  718.      beq.s    noAT
  719.      move.l   sizeOfATAK,d3
  720.      move.l   d4,d1
  721.      jsr      _LVOWrite(a6)
  722.      sub.l    d0,d3
  723.      bne      WE
  724.   ;---Write any RLSE EgPoints
  725. noAT move.l   RLSEptr,d2
  726.      beq.s    noRT
  727.      move.l   sizeOfRLSE,d3
  728.      move.l   d4,d1
  729.      jsr      _LVOWrite(a6)
  730.      sub.l    d0,d3
  731.      bne      WE
  732.   ;---write the wave's data
  733. noRT move.l   (a3)+,d2
  734.      move.l   d4,d1
  735.      addq.l   #4,a3
  736.      move.l   (a3)+,d3
  737.      jsr      _LVOWrite(a6)
  738.      sub.l    d0,d3
  739.      bne      WE
  740.   ;---do the next wave
  741.      Dbra     d5,savesam
  742.   ;---close the file and return success
  743.      move.l   d4,d1
  744.      jsr      _LVOClose(a6)
  745.      moveq    #1,d0
  746.      bra      outS
  747.  
  748.   XDEF appendstr
  749. appendstr:
  750.      move.b  (a0)+,d1
  751.      bne.s   appendstr
  752.      subq.l  #1,a0
  753. appp move.b  (a1)+,(a0)+
  754.      bne.s   appp
  755.      rts
  756.  
  757.    XDEF DoWeWantIt
  758. DoWeWantIt:
  759.     move.l  (a0),d0
  760.     cmp.l   NAME,d0
  761.     beq.s   itsNAME
  762.     cmp.l   ATAK,d0
  763.     beq.s   itsATAK
  764.     cmp.l   RLSE,d0
  765.     beq.s   itsRLSE
  766.     sub.l   BODY,d0
  767.     bne.s   unKn
  768.     rts
  769. itsNAME:
  770.     moveq   #1,d0
  771.     rts
  772. itsATAK:
  773.     moveq   #2,d0
  774.     rts
  775. itsRLSE:
  776.     moveq   #3,d0
  777.     rts
  778. unKn:
  779.     moveq   #-1,d0
  780.     rts
  781.  
  782.     ; SECTION ToSAMPData,Data   ;UnComment if not using CAPE
  783.  
  784.    XDEF   newWindow
  785. newWindow:
  786.           dc.w   0,0
  787.           dc.w   640,200
  788.           dc.b   0,1
  789.  ;IDCMP = MOUSEBUTTONS|CLOSEWINDOW|RAWKEY
  790.           dc.l   $608
  791. ;WindowFlags = WINDOWCLOSE|WINDOWDEPTH|SMART_REFRESH|ACTIVATE (no FOLLOWMOUSE
  792. ;allowed as that messes up the requester when using DoFileIO(). If you need
  793. ;FOLLOWMOUSE, then use DoFileIOWindow() to open the req in its own window.)
  794.           dc.l   $100C
  795.           dc.l   0
  796.           dc.l   0
  797.           dc.l   WINTITLE
  798. ScreenPtr dc.l   0
  799.           dc.l   0
  800.           dc.w   96,30
  801.           dc.w   320,200
  802.           dc.w   1         ;WBENCHSCREEN
  803.  
  804. TextAttr:        ;Topaz 8 is a ROM font so doesn't need to be opened
  805.    dc.l   FONTNAME
  806.    dc.w   8      ;TOPAZ_EIGHTY
  807.    dc.b   0,0
  808.  
  809.   XDEF _GfxBase,_IntuitionBase,_RequesterBase,WindowPtr,RastPort
  810.   XDEF _8SVXData,FileSize,FileIO,RequesterName,nameNULL,name,nameSize,NAME
  811.  
  812. _GfxBase       dc.l  0
  813. _IntuitionBase dc.l  0
  814. _RequesterBase dc.l  0
  815. WindowPtr      dc.l  0
  816. RastPort       dc.l  0
  817. _8SVXData      dc.l  0
  818. FileSize       dc.l  0
  819. FileIO         dc.l  0
  820.  
  821. ATAK      dc.b  'ATAK'
  822. RLSE      dc.b  'RLSE'
  823. _8SVX     dc.b  '8SVXVHDR'
  824. nameNULL  dc.l  name
  825. name      ds.b  20    ;buffer for the NAME chunk
  826.  
  827.    XDEF SAMP,sizeOfChunks,MHDR,sizeOfMHDR,playMap,numOfWaves,BODY,sizeOfBODY
  828.    XDEF name,waveSize,midiSampNum,loopType,sampleRate,samplePeriod
  829.    XDEF loopStartPoint,loopEndPoint,rootNote,sizeOfATAK,ATAKptr,RLSEptr
  830.    XDEF sizeOfRLSE,SampleInfo0,sizeOfFATK
  831.  
  832. ;===================== SAMP PORTION ==========================
  833. SAMP           dc.b 'SAMP'
  834. sizeOfChunks   dc.l 518+8+8 ;MHDR size + MHDR Header + BODY Header (add
  835.                             ;sizeOfBODY, nameSize, other chunks size)
  836. ;------------------------------
  837. MHDR           dc.b 'MHDR'
  838. sizeOfMHDR     dc.l 518
  839. numOfWaves     dc.b 0
  840. sampleFormat   dc.b 8
  841. Flags          dc.b 0
  842. playMode       dc.b 1   ;MULTI default
  843. numOfChans     dc.b 4   ;each midi note has 4 bytes in the playMap
  844. mhdrPad        dc.b 0
  845. playMap        ds.l 128 ;4 bytes for each of 128 midi notes
  846. NAME           dc.b 'NAME'
  847. nameSize       dc.l 0
  848.  
  849. ;------------------------------
  850. BODY           dc.b 'BODY'
  851. sizeOfBODY     dc.l 0 ;add size of ATAK, RLSE, waveSize, and 80 bytes
  852.                       ;(for each wave's header)
  853.   ;for each wave, store these 80 bytes
  854. waveHeader:
  855. waveSize       dc.l 0
  856. midiSampNum    dc.w -1    ;inc for each wave
  857. loopType       dc.b 0     ;forward
  858. Itype          dc.b 0     ;unKnown
  859. samplePeriod   dc.l 55556 ;ditto
  860. sampleRate     dc.l 18000 ;assume some default 
  861. loopStartPoint dc.l 0
  862. loopEndPoint   dc.l 0
  863. rootNote       dc.b 0     ;set to the note # in middle of each octave (i.e.
  864.                           ;note number = 6 for the lowest octave)
  865. velocityStart  dc.b 0
  866. velStartTable  ds.w 16
  867. sizeOfATAK     dc.l 0
  868. sizeOfRLSE     dc.l 0
  869. sizeOfFATK     dc.l 0
  870. sizeOfFRLS     dc.l 0
  871. sizeOfUserData dc.l 0
  872. typeOfData     dc.w 0
  873.  
  874.  
  875. ATAKptr        dc.l 0
  876. RLSEptr        dc.l 0
  877.  
  878. ; For 10 waves
  879. SampleInfo0 dc.l 0 ;oneShot Start
  880.             dc.l 0 ;byte offset to loopStart
  881.             dc.l 0 ;byte offset to loopEnd (from wave beginning)
  882. SampleInfo1 dc.l 0
  883.             dc.l 0
  884.             dc.l 0
  885. SampleInfo2 dc.l 0
  886.             dc.l 0
  887.             dc.l 0
  888. SampleInfo3 dc.l 0
  889.             dc.l 0
  890.             dc.l 0
  891. SampleInfo4 dc.l 0
  892.             dc.l 0
  893.             dc.l 0
  894. SampleInfo5 dc.l 0
  895.             dc.l 0
  896.             dc.l 0
  897. SampleInfo6 dc.l 0
  898.             dc.l 0
  899.             dc.l 0
  900. SampleInfo7 dc.l 0
  901.             dc.l 0
  902.             dc.l 0
  903. SampleInfo8 dc.l 0
  904.             dc.l 0
  905.             dc.l 0
  906. SampleInfo9 dc.l 0
  907.             dc.l 0
  908.             dc.l 0
  909.  
  910.   XDEF SAMPext,Same,NoMem,ReadErr,WriteErr,Not8SVX,Cancel,CantFind
  911.   XDEF CantCreate,Quit,LibErr,Success,_BUFFER2,Directions
  912.  
  913. SAMPext        dc.b  '.SAMP',0
  914. Same           dc.b  'Would you like to save this SAMP file as',0
  915. NoMem          dc.b  'No memory for copy buffer.',0
  916. ReadErr        dc.b  'A read error occurred.',0
  917. WriteErr       dc.b  'A write error occurred.',0
  918. Not8SVX        dc.b  'Not an IFF 8SVX file',0
  919. Cancel         dc.b  'Conversion canceled',0
  920. CantFind       dc.b  'Cannot find the source file.',0
  921. CantCreate     dc.b  'Cannot create the destination file.',0
  922. WINTITLE       dc.b  '8SVX to SAMP Conversion  © 1989  dissidents',0
  923. Quit           dc.b  1
  924. LibErr         dc.b  'FileIO library failure',0
  925. Success        dc.b  '8SVX file successfully converted.',0
  926.  
  927.  ; Use the following string area for Pathname buffer
  928. _BUFFER2:
  929. GfxName        dc.b  'graphics.library',0
  930. IntuitionName  dc.b  'intuition.library',0
  931. RequesterName  dc.b  'requester.library',0
  932. FileReqErr     dc.b  'Cannot find the "requester.library"',0
  933. IOerR          dc.b  'Cannot get a FileIO structure.',0
  934. FONTNAME       dc.b  'topaz.font',0
  935.                ds.b  130
  936.  
  937. Click          dc.b  'Click mouse for file selection or CLOSEWINDOW.',0
  938. Directions:
  939.  dc.b 'This program will convert an IFF 8SVX sampled sound file to the SAMP',0 
  940.  dc.b 'format. It requires the FileIO library in the libs drawer of your boot',0
  941.  dc.b 'disk. Click the mouse select button to begin filename selection, or',0
  942.  dc.b 'click on the CLOSE gadget to exit. Select the name of the 8SVX file to',0
  943.  dc.b 'be converted via the FileIO requester, then select OK. If the file is',0
  944.  dc.b 'successfully loaded and converted, you will be prompted to save the',0
  945.  dc.b 'new SAMP file in the same directory with a .SAMP extention added. You',0
  946.  dc.b 'may otherwise choose to enter a new name via the FileIO string gadgets.',0
  947.  dc.b 'If the SAMP file is successfully saved, a requester will indicate so.',0
  948.  dc.b 'This program was written by Jeff Glatt of dissidents.',0
  949. Family:
  950.  dc.b 'Press one of the following keys for the instrument family',0
  951.  dc.b ' ',0
  952.  dc.b 'Q = String',0
  953.  dc.b 'W = Woodwind',0
  954.  dc.b 'E = Keyboard',0
  955.  dc.b 'R = Guitar',0
  956.  dc.b 'T = Voice',0
  957.  dc.b 'Y = Drum1',0
  958.  dc.b 'U = Drum2',0
  959.  dc.b 'I = Percussion1',0
  960.  dc.b 'O = Brass1',0
  961.  dc.b 'P = Brass2',0
  962.  dc.b 'A = Cymbal',0
  963.  dc.b 'S = Effect1',0
  964.  dc.b 'D = Effect2',0
  965.  dc.b 'F = Synth',0
  966.  dc.b 'Hit RETURN for Unknown',0
  967. SPACES:
  968.  dc.b '                                                                        ',0
  969.  
  970.  CNOP 0,2
  971. TYPES dc.l STRING,WOOD,KEY,GUIT,VOICE,DR1,DR2,PER1,BRASS1,BRASS2
  972.       dc.l CYMBAL,EFF1,EFF2,SYNTH
  973. STRING: dc.b 15-1
  974.  dc.b 'Q = Violin bowed',0
  975.  dc.b 'W = Violin pluck',0
  976.  dc.b 'E = Violin Glissando',0
  977.  dc.b 'R = Violin tremulo',0
  978.  dc.b 'T = Viola bow',0
  979.  dc.b 'Y = Viola pluck',0
  980.  dc.b 'U = Viola glis.',0
  981.  dc.b 'I = Viola trem.',0
  982.  dc.b 'O = Cello bow',0
  983.  dc.b 'P = Cello pluck',0
  984.  dc.b 'A = Cello glis.',0
  985.  dc.b 'S = Cello trem.',0
  986.  dc.b 'D = Bass bowed',0
  987.  dc.b 'F = Bass pluck (jazz bass)',0
  988.  dc.b 'G = Bass trem.',0
  989. BRASS1 dc.b 14-1
  990.  dc.b 'Q = Baritone sax',0
  991.  dc.b 'W = Bari Growl',0
  992.  dc.b 'E = Tenor Sax',0
  993.  dc.b 'R = Tenor Growl',0
  994.  dc.b 'T = Alto Sax',0
  995.  dc.b 'Y = Alto Growl',0
  996.  dc.b 'U = Soprano sax',0
  997.  dc.b 'I = Soprano Growl',0
  998.  dc.b 'O = Trumpet',0
  999.  dc.b 'P = Muted Trumpet',0
  1000.  dc.b 'A = Trumpet Drop',0
  1001.  dc.b 'S = Trombone',0
  1002.  dc.b 'D = Trombone slide',0
  1003.  dc.b 'F = Trombone Mute',0
  1004. BRASS2: dc.b 4-1
  1005.  dc.b 'Q = French Horn',0
  1006.  dc.b 'W = Tuba',0
  1007.  dc.b 'E = Flugal Horn',0
  1008.  dc.b 'R = English Horn',0
  1009. WOOD: dc.b 9-1
  1010.  dc.b 'Q = Clarinet',0
  1011.  dc.b 'W = Flute',0
  1012.  dc.b 'E = Pan Flute',0
  1013.  dc.b 'R = Oboe',0
  1014.  dc.b 'T = Piccolo',0
  1015.  dc.b 'Y = Recorder',0
  1016.  dc.b 'U = Basson',0
  1017.  dc.b 'I = Bass Clarinet',0
  1018.  dc.b 'O = Harmonica',0
  1019. KEY: dc.b 10-1
  1020.  dc.b 'Q = Grand Piano',0
  1021.  dc.b 'W = Elec. Piano',0
  1022.  dc.b 'E = HonkyTonk Piano',0
  1023.  dc.b 'R = Toy Piano',0
  1024.  dc.b 'T = Harpsichord',0
  1025.  dc.b 'Y = Clavinet',0
  1026.  dc.b 'U = Pipe Organ',0
  1027.  dc.b 'I = Hammond B-3',0
  1028.  dc.b 'O = Farfisa Organ',0
  1029.  dc.b 'P = Harp',0
  1030. DR1: dc.b 15-1
  1031.  dc.b 'Q = Kick',0
  1032.  dc.b 'W = Snare',0
  1033.  dc.b 'E = Tom',0
  1034.  dc.b 'R = Timbales',0
  1035.  dc.b 'T = Conga Hit',0
  1036.  dc.b 'Y = Conga Slap',0
  1037.  dc.b 'U = Brush Snare',0
  1038.  dc.b 'I = Elec. Snare',0
  1039.  dc.b 'O = Elec. Kick',0
  1040.  dc.b 'P = Elec. Tom',0
  1041.  dc.b 'A = RimShot',0
  1042.  dc.b 'S = Cross Stick',0
  1043.  dc.b 'D = Bongo',0
  1044.  dc.b 'F = Steel Drum',0
  1045.  dc.b 'G = Double Tom',0
  1046. DR2: dc.b 3-1
  1047.  dc.b 'Q = Timbani',0
  1048.  dc.b 'W = Timpani Roll',0
  1049.  dc.b 'E = Log Drum',0
  1050. PER1: dc.b 12-1
  1051.  dc.b 'Q = Block',0
  1052.  dc.b 'W = Cowbell',0
  1053.  dc.b 'E = Triangle',0
  1054.  dc.b 'R = Tambourine',0
  1055.  dc.b 'T = Whistle',0
  1056.  dc.b 'Y = Maracas',0
  1057.  dc.b 'U = Bell',0
  1058.  dc.b 'I = Vibes',0
  1059.  dc.b 'O = Marimba',0
  1060.  dc.b 'P = Xylophone',0
  1061.  dc.b 'A = Tubular Bells',0
  1062.  dc.b 'S = Glockenspeil',0
  1063. CYMBAL: dc.b 10-1
  1064.  dc.b 'Q = Closed Hihat',0
  1065.  dc.b 'W = Open Hihat',0
  1066.  dc.b 'E = Step Hihat',0
  1067.  dc.b 'R = Ride',0
  1068.  dc.b 'T = Bell Cymbal',0
  1069.  dc.b 'Y = Crash',0
  1070.  dc.b 'U = Choke Crash ',0
  1071.  dc.b 'I = Gong',0
  1072.  dc.b 'O = Bell Tree',0
  1073.  dc.b 'P = Cymbal Roll',0
  1074. GUIT: dc.b 15-1
  1075.  dc.b 'Q = Electric',0
  1076.  dc.b 'W = Muted Electric',0
  1077.  dc.b 'E = Distorted',0
  1078.  dc.b 'R = Acoustic',0
  1079.  dc.b 'T = 12-String',0
  1080.  dc.b 'Y = Nylon String',0
  1081.  dc.b 'U = Power Chord',0
  1082.  dc.b 'I = Harmonics',0
  1083.  dc.b 'O = Chord Strum',0
  1084.  dc.b 'P = Banjo',0
  1085.  dc.b 'A = Elec. Bass',0
  1086.  dc.b 'S = Slapped Bass',0
  1087.  dc.b 'D = Popped Bass',0
  1088.  dc.b 'F = Sitar',0
  1089.  dc.b 'G = Mandolin',0
  1090. VOICE: dc.b 7-1
  1091.  dc.b 'Q = Male Ahh',0
  1092.  dc.b 'W = Female Ahh',0
  1093.  dc.b 'E = Male OOO',0
  1094.  dc.b 'R = Female OOO',0
  1095.  dc.b 'T = Female Breathy',0
  1096.  dc.b 'Y = Laugh',0
  1097.  dc.b 'U = Whistle',0
  1098. EFF1: dc.b 15-1
  1099.  dc.b 'Q = Explosion',0
  1100.  dc.b 'W = Gunshot',0
  1101.  dc.b 'E = Creaking Door Open',0
  1102.  dc.b 'R = Door Slam',0
  1103.  dc.b 'T = Door Close',0
  1104.  dc.b 'Y = Spacegun',0
  1105.  dc.b 'U = Jet Engine',0
  1106.  dc.b 'I = Propeller',0
  1107.  dc.b 'O = Helocopter',0
  1108.  dc.b 'P = Broken Glass',0
  1109.  dc.b 'A = Thunder',0
  1110.  dc.b 'S = Rain',0
  1111.  dc.b 'D = Birds',0
  1112.  dc.b 'F = Jungle Noises',0
  1113.  dc.b 'G = Footstep',0
  1114. EFF2: dc.b 15-1
  1115.  dc.b 'Q = Machine Gun',0
  1116.  dc.b 'W = Telephone',0
  1117.  dc.b 'E = Dog bark',0
  1118.  dc.b 'R = Dog Growl',0
  1119.  dc.b 'T = Boat Whistle',0
  1120.  dc.b 'Y = Ocean',0
  1121.  dc.b 'U = Wind',0
  1122.  dc.b 'I = Crowd Boos',0
  1123.  dc.b 'O = Applause',0
  1124.  dc.b 'P = Roaring Crowds',0
  1125.  dc.b 'A = Scream',0
  1126.  dc.b 'S = Sword Clash',0
  1127.  dc.b 'D = Avalance',0
  1128.  dc.b 'F = Bouncing Ball',0
  1129.  dc.b 'G = Ball against bat or club',0
  1130. SYNTH dc.b 6-1
  1131.  dc.b 'Q = Strings',0
  1132.  dc.b 'W = Square',0
  1133.  dc.b 'E = Sawtooth',0
  1134.  dc.b 'R = Triangle',0
  1135.  dc.b 'T = Sine',0
  1136.  dc.b 'Y = Noise',0
  1137. NumOfChoices dc.b 0
  1138.